package com.yoda.mall.mysql.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yoda.mall.api.MemberApi;
import com.yoda.mall.model.entity.ums.MemberLevel;
import com.yoda.mall.mysql.mapper.MemberLevelMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class MemberApiImpl implements MemberApi {
    @Autowired
    private MemberLevelMapper memberLevelMapper;

    @Override
    public List<MemberLevel> listWithDefaultStatus(Integer defaultStatus) {
        LambdaQueryWrapper<MemberLevel> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MemberLevel::getDefaultStatus,defaultStatus).orderByAsc(MemberLevel::getId);
        return memberLevelMapper.selectList(wrapper);
    }
}
